package cloud.cloud_web_ui.controller;

import java.util.List;
 

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cloud.cloud_web_ui.model.User;
import cloud.cloud_web_ui.service.UserService;

@RestController
public class UserController {       

     @Autowired
     UserService userService;      

     @RequestMapping(value="/users")
     public ResponseEntity<List<User>> readUserInfo(){

            List<User> users=userService.searchAll();         

            return new ResponseEntity<List<User>>(users,HttpStatus.OK);

     }
     
     @RequestMapping(value="/t1")
     public ResponseEntity<String> t1(){

           String users=userService.t1();         

            return new ResponseEntity<String>(users,HttpStatus.OK);

     }

}
